package com.kfm.base.stream;


import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Demo02 {

    public static void main(String[] args) {

        // 扑克牌
        List<String> poker = new ArrayList<>();

        List<String> color = List.of("♠", "♥", "♦", "♣");
        // 点数
        List<String> points = List.of("A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K");

        for (int i = 0; i < color.size(); i++) {
            for (int j = 0; j < points.size(); j++) {
                poker.add(color.get(i) + points.get(j));
            }
        }
        System.out.println(poker);

        Collections.shuffle(poker);
        Collections.shuffle(poker);
        Collections.shuffle(poker);

        List<String> player1 = new ArrayList<>();
        List<String> player2 = new ArrayList<>();
        List<String> player3 = new ArrayList<>();
        List<String> bottom = List.of(poker.get(51), poker.get(52), poker.get(53));

        for (int count = 0, i = 0; count < 17; count ++) {
            player1.add(poker.get(i ++));
            player2.add(poker.get(i ++));
            player3.add(poker.get(i ++));
        }

        Collections.sort(player1);
        Collections.sort(player2);
        Collections.sort(player3);

        System.out.println(player1);
        System.out.println(player2);
        System.out.println(player3);

        System.out.println(bottom);

    }
}
